package eshin.blog.utils;

import java.util.Date;


public class LoginCheckUtil {

	private final static String USERNAME = "admin";
	private final static String PASSWORD = "admin";
	/**
	 * 用户校验
	 * @param username
	 * @param password
	 * @return
	 */
	public static boolean checkUserPwd(String username,String password){
		if(USERNAME.equals(username) && PASSWORD.equals(password)){
			return true;
		}else{
			return false;
		}
	}
	/**
	 * 用户冻结剩余时间
	 * @param info
	 * @return 冻结持续时间
	 */
	public static double checkLockTime(double lockTime){
		double curTime = new Date().getTime();
		double lockLast = (curTime-lockTime)/(1000*3600.00);
		int lastTemp = (int) (lockLast*10000);
		lockLast=lastTemp/10000.0000;
		return lockLast;
	}
	/**
	 * 
	 * @param maxRetryTimes
	 * @param curRetryTime
	 * @return
	 */
	public static boolean checkOverTry(int maxRetryTimes, int curRetryTime){
		if(curRetryTime<maxRetryTimes){
			return false;
		}else{
			return true;
		}
	}
	
	
}
